import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: 'login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register/register.vue')
  },
  {
    path: '/stockDetails',
    name: 'StockDetails',
    component: () => import('../views/Stock/Stock.vue')
  },
  {
    path: '/Asset',
    name: 'Asset',
    component: () => import('../views/Asset/Asset.vue'),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/Trade',
    name: 'Trade',
    component: () => import('../views/Trade/Trade.vue'),
    meta: {
      requireAuth: true
    }
  },
  {
    path: '/History',
    name: 'History',
    component: () => import('../views/History/History.vue'),
    meta: {
      requireAuth: true
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
